//-------------------------------------------------------------------------------
//	file debug.h
//	brief
//
//	$Id: debug.h 250 2014-03-23 12:29:22Z ac.verbeck@gmail.com $
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//	Copyright and Disclaimer Notice
//
//	Copyright (c) 2013-2014 A.C. Verbeck
//
//	This file is part of debug: A trace / debug library
//
//	db-test is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	db-test is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with db-test.  If not, see <http://www.gnu.org/licenses/>.
//
//------------------------------------------------------------------------------

typedef enum { INFO, DEBUG, WARNING, CRITICAL } TRACE_LEVEL;

void TRACE_init(bool in);
void _TR(TRACE_LEVEL tr_lvl, const char* file, const char* func, uint16_t line, ...);
void _TR_entry(const char* file, const char* func);
void _TR_exit(const char* file, const char* func);
void ErrorExit(const char* pfunc);

#ifdef BLD_DEBUG
#define TRACE(tl,...)	_TR(tl, __FILE__, __func__, __LINE__, __VA_ARGS__);
#define TRACE_ENTRY()	_TR_entry(__FILE__, __func__);
#define TRACE_EXIT()	_TR_exit(__FILE__, __func__);
#else
#define TRACE(tl,...)	;
#endif

//
//	End: debug.h
//
